package com.zerdoor.controller;

import com.zerdoor.service.ArtistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Project: acg
 * Module ID: 003
 * Comments: 艺术家显示
 * JDK version used: JDK1.7
 * Namespace: controller
 * Author：xiaoji
 * Create Date：2014-10-31
 * Modified By：   <修改人中文名或拼音缩写>
 * Modified Date:  <修改日期，格式:YYYY-MM-DD>
 * Why & What is modified  <修改原因描述>
 * Version:                  <版本号>
 */
@Controller
@RequestMapping("/artist")
public class ArtistController {
    @Autowired
    private ArtistService artistService;
    @RequestMapping("/index")
    public String index(Model model){

        //新艺术家
        model.addAttribute("news",artistService.getNewArtists());
        //作品
        model.addAttribute("pros",artistService.getArtistProduction());
        //知名艺术家
        model.addAttribute("famous",artistService.getFamousArtists());
        //人气排行榜
        model.addAttribute("hots",artistService.getHotArtists());
        //月收入排行榜
        model.addAttribute("incomes",artistService.getIncomeArtistsByMonth());
        return "/artist/index";
    }
}
